package a.j;

import a.c.z;
import a.d.n;
import a.d.o;
import a.d.s;
import a.d.w;
import a.d.y;
import a.f.wb;
import a.f.wc;
import a.f.xb;
import a.f.zb;
import a.f.zc;
import a.c.z;

public class re
  implements xb, vf.e_
{
  public static final int a = 0;
  public static final int b = 1;
  public static final int c = 2;
  public static final int d = 3;
  public static final int e = 4;
  public static final int f = 5;
  public static final int g = 6;
  public static final int h = 7;
  public static final int i = 8;
  private static final double j = 0.0001D;
  private double k = 10.0D;
  private boolean l;
  private double m;
  private boolean n;
  public static boolean o;
  
  public boolean c()
  {
    return this.l;
  }
  
  public void a(boolean paramBoolean)
  {
    this.l = paramBoolean;
  }
  
  public boolean d()
  {
    return this.n;
  }
  
  public void b(boolean paramBoolean)
  {
    this.n = paramBoolean;
  }
  
  public double e()
  {
    return this.m;
  }
  
  public void a(double paramDouble)
  {
    this.m = paramDouble;
  }
  
  public double f()
  {
    return this.k;
  }
  
  public void b(double paramDouble)
  {
    this.k = paramDouble;
  }
  
  public Object a()
  {
    return new a_(f(), e());
  }
  
  private static gg g()
  {
    return new gg();
  }
  
  public Object a(int paramInt)
  {
    double d1 = e();
    double d2 = f();
    switch (paramInt)
    {
    case 0: 
      return new a_(0, 0.0D, d2, true, (byte)0, d1);
    case 1: 
      return new a_(0, 0.0D, d2, false, (byte)2, d1);
    case 2: 
      return new a_(0, 0.0D, d2, false, (byte)1, d1);
    case 3: 
      return new a_(-1, 1.0D, d2, true, (byte)0, d1);
    case 4: 
      return new a_(-1, 1.0D, d2, false, (byte)2, d1);
    case 5: 
      return new a_(-1, 1.0D, d2, false, (byte)1, d1);
    case 6: 
      return new a_(0, 0.5D, d2, true, (byte)0, d1);
    case 7: 
      return new a_(0, 0.5D, d2, false, (byte)2, d1);
    case 8: 
      return new a_(0, 0.5D, d2, false, (byte)1, d1);
    }
    return a();
  }
  
  public o a(s params, zb paramzb, zc paramzc1, zc paramzc2, Object paramObject)
  {
    if (!ld.E) {}
    a_ locala_ = (a_)(paramObject == null ? a() : paramObject);
    gg localgg = g();
    a(localgg, locala_, c());
    return localgg.a(params, paramzb, paramzc1, paramzc2, locala_);
  }
  
  private void a(gg paramgg, a_ parama_, boolean paramBoolean)
  {
    a(paramgg, parama_.e(), parama_, paramBoolean);
  }
  
  private void a(gg paramgg, byte paramByte, a_ parama_, boolean paramBoolean)
  {
    paramgg.e(parama_.d());
    paramgg.c(parama_.f());
    paramgg.a(parama_.c());
    paramgg.a(paramBoolean);
    paramgg.c(d());
    paramgg.a(paramByte);
  }
  
  private void a(gg paramgg, byte paramByte, o paramo, boolean paramBoolean1, boolean paramBoolean2, a_ parama_, boolean paramBoolean3)
  {
    if (!ld.E)
    {
      if ((paramBoolean2) || (parama_ == null))
      {
        paramgg.e(paramBoolean1);
        paramgg.c(6.283185307179586D - paramo.k());
        paramgg.a(f());
        paramgg.a(paramBoolean3);
        paramgg.c(d());
        paramgg.a(paramByte);
      }
    }
    else if (!ld.D) {
      return;
    }
    a(paramgg, paramByte, parama_, paramBoolean3);
  }
  
  public z a(wb paramwb, zb paramzb, zc paramzc1, zc paramzc2)
  {
    boolean bool = ld.E;
    Object localObject = paramwb.e();
    if (!bool) {
      if ((localObject instanceof a_))
      {
        if (bool) {
          break label51;
        }
        locala_ = (a_)localObject;
        if (!ld.D) {
          break label53;
        }
      }
    }
    label51:
    a_ locala_ = (a_)a();
    label53:
    z localz = new z();
    gg localgg = g();
    a(localgg, (byte)0, locala_, c());
    localz.a(localgg.a(paramwb, paramzb, paramzc1, paramzc2, locala_));
    a(localgg, (byte)2, locala_, c());
    localz.a(localgg.a(paramwb, paramzb, paramzc1, paramzc2, locala_));
    a(localgg, (byte)1, locala_, c());
    localz.a(localgg.a(paramwb, paramzb, paramzc1, paramzc2, locala_));
    return localz;
  }
  
  public Object a(o paramo, zb paramzb, zc paramzc1, zc paramzc2)
  {
    if (a(paramo)) {
      throw new IllegalArgumentException("Invalid label bounds: " + paramo);
    }
    return a(paramo, paramzb, paramzc1, paramzc2, null, (byte)0, true);
  }
  
  public Object b(o paramo, zb paramzb, zc paramzc1, zc paramzc2)
  {
    if (a(paramo)) {
      throw new IllegalArgumentException("Invalid label bounds: " + paramo);
    }
    return a(paramo, paramzb, paramzc1, paramzc2, null, (byte)0, false);
  }
  
  public vf.d_ b()
  {
    return new lg(this);
  }
  
  public static double a(Object paramObject)
  {
    try
    {
      return ((a_)paramObject).f();
    }
    catch (ClassCastException localClassCastException)
    {
      throw new IllegalArgumentException("Invalid model parameter type.");
    }
  }
  
  private a_ a(o paramo, zb paramzb, zc paramzc1, zc paramzc2, a_ parama_, byte paramByte, boolean paramBoolean)
  {
    boolean bool5 = ld.E;
    if ((bool5) || (!paramBoolean)) {
      if (bool5) {}
    }
    boolean bool1 = c();
    if ((bool5) || (paramBoolean)) {
      if (bool5) {}
    }
    boolean bool2 = c();
    boolean bool3 = c(paramo, paramzb, paramzc1, paramzc2);
    gg localgg = g();
    Object localObject = parama_;
    double d1;
    double d2;
    if (!bool5)
    {
      if (localObject == null)
      {
        d1 = 1.7976931348623157E+308D;
        d2 = 1.7976931348623157E+308D;
        if (bool5) {
          break label146;
        }
        if (!ld.D) {}
      }
      else
      {
        a(localgg, (a_)localObject, bool1);
      }
    }
    else
    {
      d1 = a(localgg, (a_)localObject, paramo, paramzb, paramzc1, paramzc2);
      d2 = a((a_)localObject);
    }
    label146:
    if (!bool5) {}
    boolean bool4 = 2 == paramByte;
    if (!bool5)
    {
      if (bool3) {
        a(localgg, (byte)0, paramo, false, bool4, parama_, bool1);
      }
    }
    else
    {
      locala_1 = localgg.a(paramo, paramzb, paramzc1, paramzc2, parama_, paramByte, bool2);
      d3 = a(localgg, locala_1, paramo, paramzb, paramzc1, paramzc2);
      if (!bool5) {
        if (a(locala_1, d3, (a_)localObject, d1, d2))
        {
          localObject = locala_1;
          d1 = d3;
          d2 = a((a_)localObject);
        }
      }
      if (!bool5)
      {
        if (d1 < 0.0001D) {
          if (bool5) {
            break label306;
          }
        }
      }
      else if (((a_)localObject).b() >= 0.0D)
      {
        if (bool5) {
          break label306;
        }
        if (((a_)localObject).b() <= 1.0D) {
          return localObject;
        }
      }
    }
    label306:
    if ((bool5) || ((parama_ != null) || (bool3)))
    {
      if (bool5) {
        break label559;
      }
      if (parama_ != null)
      {
        if (bool5) {
          break label559;
        }
        if (parama_.d()) {}
      }
    }
    else
    {
      a(localgg, (byte)1, paramo, false, bool4, parama_, bool1);
      locala_1 = localgg.a(paramo, paramzb, paramzc1, paramzc2, parama_, paramByte, bool2);
      d3 = a(localgg, locala_1, paramo, paramzb, paramzc1, paramzc2);
      if (!bool5)
      {
        if (a(locala_1, d3, (a_)localObject, d1, d2))
        {
          localObject = locala_1;
          d1 = d3;
          d2 = a((a_)localObject);
        }
        a(localgg, (byte)2, paramo, false, bool4, parama_, bool1);
      }
      locala_2 = localgg.a(paramo, paramzb, paramzc1, paramzc2, parama_, paramByte, bool2);
      d4 = a(localgg, locala_2, paramo, paramzb, paramzc1, paramzc2);
      if (!bool5) {
        if (a(locala_2, d4, (a_)localObject, d1, d2))
        {
          localObject = locala_2;
          d1 = d4;
          d2 = a((a_)localObject);
        }
      }
      if (!bool5)
      {
        if (d1 < 0.0001D) {
          if (bool5) {
            break label559;
          }
        }
      }
      else if (((a_)localObject).b() >= 0.0D)
      {
        if (bool5) {
          break label559;
        }
        if (((a_)localObject).b() <= 1.0D) {
          return localObject;
        }
      }
    }
    label559:
    if (!bool5) {
      if (parama_ != null)
      {
        if (!bool5) {
          if ((!parama_.d()) && ((!bool5) && ((!bool3) || (!bool4)))) {
            break label803;
          }
        }
      }
      else {
        a(localgg, (byte)1, paramo, true, bool4, parama_, bool1);
      }
    }
    a_ locala_1 = localgg.a(paramo, paramzb, paramzc1, paramzc2, parama_, paramByte, bool2);
    double d3 = a(localgg, locala_1, paramo, paramzb, paramzc1, paramzc2);
    if (!bool5)
    {
      if (a(locala_1, d3, (a_)localObject, d1, d2))
      {
        localObject = locala_1;
        d1 = d3;
        d2 = a((a_)localObject);
      }
      a(localgg, (byte)2, paramo, true, bool4, parama_, bool1);
    }
    a_ locala_2 = localgg.a(paramo, paramzb, paramzc1, paramzc2, parama_, paramByte, bool2);
    double d4 = a(localgg, locala_2, paramo, paramzb, paramzc1, paramzc2);
    if (!bool5) {
      if (a(locala_2, d4, (a_)localObject, d1, d2))
      {
        localObject = locala_2;
        d1 = d4;
      }
    }
    if (!bool5)
    {
      if (d1 < 0.0001D) {
        if (bool5) {
          break label805;
        }
      }
    }
    else if (((a_)localObject).b() >= 0.0D)
    {
      if (bool5) {
        break label805;
      }
      if (((a_)localObject).b() <= 1.0D) {
        return localObject;
      }
    }
    label803:
    label805:
    if (!bool5) {
      if (localObject == null) {
        return (a_)a();
      }
    }
    if (!bool5) {
      if (parama_ != null)
      {
        if (bool5) {
          break label874;
        }
        if (localObject.equals(parama_))
        {
          a(localgg, parama_, bool1);
          return localgg.a(paramo, paramzb, paramzc1, paramzc2, parama_, (byte)1, bool2);
        }
      }
    }
    label874:
    return localObject;
  }
  
  private double a(gg paramgg, a_ parama_, o paramo, zb paramzb, zc paramzc1, zc paramzc2)
  {
    o localo = paramgg.a(paramo.f(), paramzb, paramzc1, paramzc2, parama_);
    if (!ld.E) {
      if (o.a(paramo, localo, 0.0001D)) {
        return 0.0D;
      }
    }
    return w.a(paramo.l(), localo.l());
  }
  
  private static double a(a_ parama_)
  {
    if (!ld.E) {
      if (parama_.e() == 0) {
        return Math.abs(parama_.b());
      }
    }
    return Math.abs(parama_.c()) + Math.abs(parama_.b());
  }
  
  private static boolean a(a_ parama_1, double paramDouble1, a_ parama_2, double paramDouble2, double paramDouble3)
  {
    boolean bool = ld.E;
    if (parama_2 != null)
    {
      if (bool) {
        break label57;
      }
      if (paramDouble1 + 0.0001D >= paramDouble2)
      {
        if ((!bool) && (paramDouble2 + 0.0001D <= paramDouble1)) {
          break label60;
        }
        if (bool) {
          break label57;
        }
      }
    }
    label57:
    label60:
    return a(parama_1) < paramDouble3;
  }
  
  private static boolean c(o paramo, zb paramzb, zc paramzc1, zc paramzc2)
  {
    boolean bool = ld.D;
    y localy = wc.a(paramzb, paramzc1, paramzc2, 0.0D);
    int i1 = 0;
    do
    {
      if (i1 >= localy.j() - 1) {
        break;
      }
      n localn = localy.a(i1);
      if (bool) {
        break label64;
      }
      if (o.a(paramo, localn, 0.0D)) {
        return true;
      }
      i1++;
    } while (!bool);
    label64:
    return false;
  }
  
  a_ a(o paramo, tb paramtb, a_ parama_, byte paramByte)
  {
    if (a(paramo)) {
      throw new IllegalArgumentException("Invalid label bounds: " + paramo);
    }
    return a(paramo, paramtb, paramtb.h(), paramtb.g(), parama_, paramByte, false);
  }
  
  static boolean a(o paramo)
  {
    boolean bool = ld.E;
    if (!bool) {
      if (!Double.isNaN(paramo.d()))
      {
        if (bool) {
          break label89;
        }
        if (!Double.isNaN(paramo.e()))
        {
          if (bool) {
            break label89;
          }
          if (!Double.isNaN(paramo.g()))
          {
            if (bool) {
              break label89;
            }
            if (!Double.isNaN(paramo.h()))
            {
              if (bool) {
                break label89;
              }
              if (!Double.isNaN(paramo.i())) {
                if (bool) {
                  break label89;
                }
              }
            }
          }
        }
      }
    }
    label89:
    return Double.isNaN(paramo.j());
  }
  
  public static class a_
  {
    public static final byte a = 0;
    public static final byte b = 2;
    public static final byte c = 1;
    private final double d;
    private final double e;
    private final double f;
    private final int g;
    private final byte h;
    private final boolean i;
    private n j;
    public static int k;
    
    a_(double paramDouble1, double paramDouble2)
    {
      this(0, 0.0D, paramDouble1, false, (byte)0, paramDouble2);
    }
    
    public a_(int paramInt, double paramDouble1, double paramDouble2, boolean paramBoolean, byte paramByte, double paramDouble3)
    {
      this.g = paramInt;
      this.d = paramDouble1;
      this.e = Math.abs(paramDouble2);
      this.i = paramBoolean;
      this.h = paramByte;
      this.f = paramDouble3;
    }
    
    public int a()
    {
      return this.g;
    }
    
    public double b()
    {
      return this.d;
    }
    
    public double c()
    {
      return this.e;
    }
    
    public boolean d()
    {
      return this.i;
    }
    
    public byte e()
    {
      return this.h;
    }
    
    public double f()
    {
      return this.f;
    }
    
    void a(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
    {
      this.j = new n(new w(paramDouble1, paramDouble2), new w(paramDouble3, paramDouble4));
    }
    
    n g()
    {
      return this.j;
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.re

 * JD-Core Version:    0.7.0.1

 */